home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / ka9q / kit_src / screen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-03  |  1.2 KB  |  60 lines

  1. /*    (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
  2.  * 
  3.  *    Redistribution and use in source and binary forms are permitted for
  4.  *    non-commercial use, provided that the above copyright notice and this
  5.  *    paragraph are duplicated in all such forms.  THIS SOFTWARE IS PROVIDED
  6.  *    ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  7.  *    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
  8.  *    FITNESS FOR A PARTICULAR PURPOSE.
  9.  */
  10. #include <stdio.h>
  11. #include "screen.h"
  12.  
  13. unsigned int
  14. screen()
  15. {
  16.     unsigned int m, n, key, not_done;
  17.  
  18.     not_done = 1;
  19.     n = 0;
  20.  
  21.     for (m = 0; m < nfields; m++)
  22.     {
  23.         puttxt(tx[m], ty[m], TSA, TFA, title[m]);
  24.         puttxt(ix[m], iy[m], ISA, IFA, ifd[m]);
  25.     }
  26.  
  27.     while ( not_done )
  28.     {
  29.         key = field(    tx[n], ty[n], tsa[n], tfa[n], title[n],
  30.                 ix[n], iy[n], isa[n], ifa[n], iif[n],
  31.                 ift[n], ifd[n], rmask[n] );
  32.         switch(key)
  33.         {
  34.         case UP:
  35.             n = up[n] - 1;
  36.             break;
  37.         case DOWN:
  38.         case CR:
  39.             n = dn[n] - 1;
  40.             break;
  41.         case LEFT:
  42.             n = l[n] - 1;
  43.             break;
  44.         case RIGHT:
  45.             n = r[n] - 1;
  46.             break;
  47.         case ESC:
  48.             clrscr();
  49.             exit(0);
  50.         case F1:
  51.             return(0);
  52.             break;
  53.         default:
  54.             not_done = 0;
  55.             break;
  56.         }
  57.     }
  58.     return(key);
  59. }
  60.